home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Unix / Piper / SampleScripts / Uncompress / script < prev   
Text File  |  1993-01-25  |  1KB  |  29 lines

  1. #!/bin/csh
  2. #This should become a C program to handle the NeXT character set.
  3. if ! -f "$1" then
  4.     echo Uncompress: I can only uncompress from files with an ASCII name! > /dev/console
  5.     exit(-1)
  6.   else if "$1" =~ *.tar.Z then
  7.     if ( "$1" == "`echo $1 | sed -e 'ss\(/.*\)/\([^/]*\)s\1/\2s'`" ) then
  8.         cd "`echo $1 | sed -e 'ss\(/.*\)/\([^/]*\)s\1s'`"
  9.     #Here should be a check to see if the archive is relative, builds its own
  10.     #directory and does that with the same name as file.tar.Z.
  11.         zcat "$1" | tar xf -
  12.       else
  13.     echo Uncompress: Can't handle the extraneous characters in a shell script! > /dev/console
  14.     exit(-1)
  15.     #Maybe this is just a misunderstanding of mine (please tell me if the test could
  16.     #be omitted, I'm RfSchtkt@banruc60.bitnet, at least on 1992-07-03 I was).
  17.     #But I get the creeps of the badly explained notion of ``character''.
  18.     #I wish one would say things like ``visible ASCII character''
  19.     #and thereby mean only 0x21 through 0x7e.
  20.     #There should also be a better explanation of how many bits are looked at,
  21.     #and if the highest is preserved or not.
  22.       endif
  23.   else if "$1" =~ *.Z then
  24.     uncompress "$1"
  25.   else
  26.     echo Uncompress: You gave me a file with the wrong extension! > /dev/console
  27.     exit(-1)
  28.   endif
  29.